/*
页面的复用的数据和逻辑
 */
import { ref, onMounted } from 'vue'
import { findBanner } from '@/api/home'
// 获取轮播图的钩子函数
export function useBanner () {
  const sliders = ref([])
  const getBannerList = async () => {
    const res = await findBanner()
    // console.log(res)
    sliders.value = res.result
  }
  onMounted(() => {
    getBannerList()
  }
  )
  return { sliders }
}
